#include <iostream>
#include<string>
using namespace std;

int main() {
	string s;
	getline(cin, s);
	size_t pos = s.rfind(' ');
	cout << pos << endl;
	cout << s.size() - pos - 1 << endl;
}
